package org.learn.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping
public class SysIndexController {
    @RequestMapping("/index")
    public String index(HttpServletRequest request, HttpServletResponse response, Model model) {
        String userName = (String) request.getSession().getAttribute("userName");
        System.out.println("当前用户：" + userName);
        model.addAttribute("userName", userName);
        return "index";


    }
}
